import globalData from "@/plugins/data";
import globalMethods from "@/plugins/methods";
import {useBaseInfoWithOut} from "@/store/modules/base-info";
import api from "@/api";
let baseInfoWithOut = useBaseInfoWithOut();

/**
 * 是否支持转发
 * @return Promise
 */
export async function  canTransSecretLevel(){
  //没有密级可以转发
  if (!baseInfoWithOut.secretLevelAble){
    return true;
  }
  let canTrans = await api.commonCheckForward(globalData.summaryId);
  if(canTrans === false){
    globalMethods.warning({
      title: globalMethods.i18n('common.system.hint.label'),
      //流程不能为空
      content: globalMethods.i18n('collaboration.grid.alert.noTransSecretData'),
    });
    return false;
  }
  return true;
}